home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / util / libs / MMULib.lha / MMULib / Lib_Sources / mu_context.asm < prev    next >
Encoding:
Assembly Source File  |  1998-10-04  |  21.9 KB  |  608 lines

  1. ;*************************************************************************
  2. ;** mmu.library                                                         **
  3. ;**                                                                     **
  4. ;** a system library for arbitration and control of the MC68K MMUs      **
  5. ;**                                                                     **
  6. ;** © 1998 THOR-Software, Thomas Richter                                **
  7. ;** No commercial use, reassembly, modification without prior, written  **
  8. ;** permission of the authors.                                          **
  9. ;** Including this library in any commercial software REQUIRES a        **
  10. ;** written permission and the payment of a small fee.                  **
  11. ;**                                                                     **
  12. ;** This is an internal header file, do not depend on anything here.    **
  13. ;** Use the official include files.                                     **
  14. ;** Distributed only for the mmu.library development group for private  **
  15. ;** use.                                                                **
  16. ;**                                                                     **
  17. ;**---------------------------------------------------------------------**
  18. ;** Block: Context related operations                                   **
  19. ;** Version 0.04                02.10.1998                              **
  20. ;*************************************************************************
  21.  
  22. ;FOLD Includes
  23.         include inc:macros.asm
  24.         include inc:exec_lib.asm
  25.         include inc:expansion_lib.asm
  26.         include mu_lib.i
  27.         include mu_context.i
  28.         include mu_alerts.i
  29. ;ENDFOLD
  30. ;FOLD External References
  31.         xref AllocContextMem
  32.         xref FreeContextMem
  33.         xref MUAlert
  34.         xref FreeMMUTable
  35. ;ENDFOLD
  36. ;FOLD Defines
  37. MemList =       $142
  38.  
  39. mh_Attributes   =       $0e
  40. mh_Lower        =       $14
  41. mh_Upper        =       $18
  42.  
  43. ERTB_MEMLIST    =       $05     ;ConfigReg type is memory
  44. er_Type         =       $10     ;Offset of the type in the configreg
  45. cd_BoardAddr    =       $20
  46. cd_BoardSize    =       $24
  47. ;ENDFOLD
  48.  
  49.         section main_code,code
  50.  
  51. ;FOLD AllocContext
  52. ;*************************************************
  53. ;** AllocContext                                **
  54. ;** allocate a context structure -> d0          **
  55. ;** or NULL on error                            **
  56. ;*************************************************
  57.         xdef AllocContext
  58. AllocContext:
  59.         saveregs a2-a3/a6
  60.         move.l #ctx_len,d0
  61.         bsr AllocContextMem
  62.         beq.s .exit
  63.         move.l d0,a2
  64.  
  65.         lea mulib_cpstart(a6),a0
  66.         lea ctx_cpstart(a2),a1
  67.         for.l #(ctx_cpend-ctx_cpstart)/4,d0
  68.          move.l (a0)+,(a1)+
  69.         next d0
  70.  
  71.         moveq #map_len,d0
  72.         bsr AllocContextMem
  73.         beq.s .exit                     ;get memory for blank mapping
  74.         move.l d0,a3
  75.         lea ctx_Mapping(a2),a1
  76.         lea ctx_Semaphore(a2),a0
  77.         NewList a1                      ;initialize the Mapping list
  78.         move.l mulib_SysBase(a6),a6
  79.         jsr InitSemaphore(a6)           ;initialize the semaphore
  80.  
  81.         subq.l #1,map_higher(a3)        ;higher address is 0xfff.fff
  82.         bsetm mapp_blank,map_properties(a3)     ;blank space, access must be emulated
  83.         bsetm ctxf_dirty,ctx_flags(a2)          ;this context lacks a CPU table
  84.         bsetm mapf_dirty,map_flags(a3)          ;CPU Table is yet to be build
  85.         lea ctx_Mapping(a2),a0
  86.         move.l a3,a1
  87.         AddHead
  88.  
  89.         move.l a2,d0
  90.         bra.s .exit
  91. .free:                                  ;on error
  92.         move.l a2,a1
  93.         bsr FreeContextMem
  94.         moveq #0,d0
  95. .exit:
  96.         loadregs
  97.         rts
  98. ;ENDFOLD
  99. ;FOLD FreeContext
  100. ;*************************************************
  101. ;** FreeContext                                 **
  102. ;** release the context structure in *a0        **
  103. ;*************************************************
  104.         xdef FreeContext
  105. FreeContext:
  106.         saveregs a2
  107.         move.l a0,a2
  108.  
  109.         btstm ctxf_active,ctx_Flags(a2) ;is this thing active ?
  110.         beq.s .releaseme
  111.  
  112.         pea AN_FreeActive
  113.         bsr MUAlert
  114.         bra.s .exit
  115.  
  116. .releaseme:
  117.         do
  118.          lea ctx_Mapping(a2),a0
  119.          RemHead
  120.          tst.l d0
  121.          break.s eq
  122.          move.l d0,a1
  123.          bsr FreeContextMem             ;release the mapping nodes
  124.         loop.s
  125.  
  126.                                         ;now release the complete MMU table
  127.         move.l a2,a0
  128.         bsr FreeMMUTable
  129.  
  130.         move.l a2,a1
  131.         bsr FreeContextMem              ;release the context itself
  132.  
  133. .exit:
  134.         loadregs
  135.         rts
  136. ;ENDFOLD
  137. ;FOLD LockContext
  138. ;*************************************************
  139. ;** LockContext                                 **
  140. ;** Lock the context in *a0                     **
  141. ;** does not alter any registers                **
  142. ;*************************************************
  143.         xdef LockContext
  144. LockContext:
  145.         saveregs a0/a6
  146.         move.l mulib_SysBase(a6),a6
  147.         lea ctx_Semaphore(a0),a0
  148.         jsr ObtainSemaphore(a6)
  149.         loadregs
  150.         rts
  151. ;ENDFOLD
  152. ;FOLD UnlockContext
  153. ;*************************************************
  154. ;** UnlockContext                               **
  155. ;** Unlock, i.e. release the semaphore *a0      **
  156. ;** does not alter any registers                **
  157. ;*************************************************
  158.         xdef UnlockContext
  159. UnlockContext:
  160.         saveregs a0/a6
  161.         move.l mulib_SysBase(a6),a6
  162.         lea ctx_Semaphore(a0),a0
  163.         jsr ReleaseSemaphore(a6)
  164.         loadregs
  165.         rts
  166. ;ENDFOLD
  167.  
  168. ;FOLD DefineMapping
  169. ;*************************************************
  170. ;** DefineMapping                               **
  171. ;** add a new mapping for the context *a0       **
  172. ;** given in *a1                                **
  173. ;** returns FALSE in case of failure            **
  174. ;** Does NOT force a rebuild of the MMU tables  **
  175. ;** but sets the dirty flags                    **
  176. ;** doesn't do any sanity checks                **
  177. ;*************************************************
  178.         xdef DefineMapping
  179. DefineMapping:
  180.         saveregs a2-a4/d2-d7
  181.  
  182.         move.l a0,a2                    ;keep the context
  183.         move.l a1,a3                    ;and the new mapping
  184.         bsr LockContext                 ;need exclusive access
  185.  
  186.         movem.l map_lower(a3),d2-d3     ;lower bounds
  187.         move.l ctx_Mapping(a2),a4       ;get the first mapping node
  188.         do
  189.          tst.l (a4)                     ;end of the list reached ?
  190.          beq .okdone
  191.          movem.l map_lower(a4),d4-d5    ;get bounds here, too
  192.          move.l d2,d6
  193.          move.l d3,d7
  194.          cmp.l d2,d4
  195.          blo.s .nomax
  196.          move.l d4,d6                   ;get maximum of minima
  197. .nomax:
  198.          cmp.l d3,d5
  199.          bhi.s .nomin
  200.          move.l d5,d7                   ;get minimum of maxima
  201. .nomin:
  202.                                         ;[d6,d7] is now the intersection
  203.          cmp.l d6,d7
  204.          bls .nextchk                   ;intersection emtpy?
  205.                                         ;the intersection is always A PART of the already existing node!
  206.                                         ;check whether we've to modify anything at all!
  207.          movem.l map_Properties(a3),d0/a0       ;properties and delta
  208.          move.l map_Properties(a4),d1
  209.          cmp.l map_Delta(a4),a0
  210.          bne.s .modify                  ;if equal, do not modify this
  211.          eor.l d0,d1
  212.          and.l map_Mask(a3),d1
  213.          beq .next
  214.  
  215. .modify:
  216.          cmp.l d4,d6                    ;remove a lower part of this block?
  217.          beq.s .noadjustbottom
  218.                                         ;here we've to set aside the lower part of the old block
  219.          moveq #map_len,d0
  220.          bsr AllocContextMem            ;get memory
  221.          beq .fail                      ;on failure: exit
  222.          move.l d0,a1                   ;keep it
  223.          move.l map_Properties(a4),map_Properties(a1)
  224.          bsetm mapf_dirty,map_flags(a4)         ;this is dirty
  225.          move.l d6,d0
  226.          move.l map_UserPtr(a4),map_UserPtr(a1) ;copy properties
  227.          subq.l #1,d0
  228.          move.l map_lower(a4),map_lower(a1)     ;lower is this one
  229.          move.l map_flags(a4),map_flags(a1)     ;copy the flags, too
  230.          move.l d0,map_higher(a1)               ;insert higher
  231.          move.l d6,map_lower(a4)                ;modify lower of this thing
  232.          bsetm ctxf_dirty,ctx_Flags(a2)         ;context is dirty, too
  233.          move.l a4,a0
  234.          InsertBefore                           ;insert that in front of me
  235.          reloop                                 ;rerun with the modified node
  236.  
  237. .noadjustbottom:                                ;check now the head
  238.          cmp.l d5,d7
  239.          beq.s .noadjusttop
  240.  
  241.          moveq #map_len,d0
  242.          bsr AllocContextMem                    ;get memory
  243.          beq .fail                              ;on failure: exit
  244.          move.l d0,a1                           ;keep it
  245.          move.l map_Properties(a4),map_Properties(a1)
  246.          bsetm mapf_dirty,map_flags(a4)         ;this is dirty
  247.          move.l d7,d0
  248.          move.l map_UserPtr(a4),map_UserPtr(a1) ;copy properties
  249.          addq.l #1,d0
  250.          move.l map_higher(a4),map_higher(a1)   ;higher is this one
  251.          move.l map_flags(a4),map_flags(a1)     ;copy the flags, too
  252.          move.l d0,map_lower(a1)                ;insert new lower
  253.          move.l d7,map_higher(a4)               ;modify higher of this thing
  254.          bsetm ctxf_dirty,ctx_Flags(a2)         ;context is dirty, too
  255.          move.l a4,a0
  256.          InsertAfter                            ;insert that in behind me
  257.          reloop                                 ;rerun with the modified node
  258.  
  259. .noadjusttop:                                   ;here: The thing fits perfectly. Insert the modified properties
  260.          move.l map_Properties(a4),d0           ;A: old properties
  261.          move.l map_Properties(a3),d1           ;B: new properties
  262.          move.l map_UserPtr(a3),map_UserPtr(a4)
  263.          eor.l d0,d1                            ;AxB
  264.          bsetm mapf_dirty,map_flags(a4)         ;something was modified
  265.          and.l map_Mask(a3),d1                  ;and M
  266.          eor.l d0,d1                            ;xA
  267.          bsetm ctxf_dirty,ctx_flags(a2)         ;ditto in the context
  268.          move.l d1,map_Properties(a4)           ;=((AxB)^M)xA)=(A^M)v(A^_M)
  269.                                                 ;now check if the lower neighbor has the same
  270.                                                 ;properties. If so, we can remove it
  271.          move.l 4(a4),a1                        ;get lower
  272.          move.l a1,d0
  273.          tst.l 4(a1)                            ;really available ?
  274.          beq.s .chkupper
  275.  
  276.          lea map_Properties(a4),a0
  277.          lea map_Properties(a1),a1
  278.          cmp.l (a0)+,(a1)+
  279.          bne.s .chkupper
  280.          cmp.l (a0)+,(a1)+
  281.          bne.s .chkupper
  282.                                                 ;here: Identical. Remove lower
  283.          move.l d0,a1                           ;restore lower
  284.          move.l map_flags(a1),d1
  285.          move.l d0,d6
  286.          move.l map_lower(a1),map_lower(a4)     ;carry over the lower boundary
  287.          or.l d1,map_flags(a4)                  ;carry over flags
  288.          Remove                                 ;remove this node
  289.          move.l d6,a1
  290.          bsr FreeContextMem                     ;release it again
  291. .chkupper:
  292.          move.l (a4),a1                         ;get next
  293.          move.l a1,d0
  294.          tst.l (a1)                             ;is there a next
  295.          beq.s .nextchk                         ;no, so we're done
  296.  
  297.          lea map_Properties(a4),a0
  298.          lea map_Properties(a1),a1
  299.          cmp.l (a0)+,(a1)+
  300.          bne.s .nextchk
  301.          cmp.l (a0)+,(a1)+
  302.          bne.s .nextchk
  303.  
  304.          move.l d0,a1                           ;restore upper
  305.          move.l map_flags(a1),d1
  306.          move.l d0,d6
  307.          move.l map_higher(a1),map_higher(a4)   ;carry over the lower boundary
  308.          or.l d1,map_flags(a4)                  ;carry over flags
  309.          Remove                                 ;remove this node
  310.          move.l d6,a1
  311.          bsr FreeContextMem                     ;release it again
  312. .nextchk:
  313.          cmp.l d4,d3
  314.          blo.s .okdone
  315. .next:
  316.          move.l (a4),a4                         ;get next mapping segment
  317.         loop
  318.  
  319. .okdone:
  320.         moveq #1,d0
  321. .fail:
  322.         move.l a2,a0
  323.         bsr UnlockContext
  324.         tst.l d0
  325.         loadregs
  326.         rts
  327. ;ENDFOLD
  328. ;FOLD BuildDefaultTable
  329. ;*************************************************
  330. ;** BuildDefaultTable                           **
  331. ;**                                             **
  332. ;** if no default table is present, build one   **
  333. ;** by scanning the ROM,RAM and the extensions  **
  334. ;** Context *a0                                 **
  335. ;*************************************************
  336.         xdef BuildDefaultTable
  337. BuildDefaultTable:
  338.         saveregs a2/a4-a5
  339.         move.l a0,a2                            ;keep context
  340.         move.l a7,a4                            ;keep stack
  341.  
  342.         move.l #$f00000,a0
  343.         move.l #$f80000,a1                      ;diagnostic ROM
  344.         move.l #(1<<mapp_rom),d0                ;status
  345.         bsr _AddMap
  346.         beq .fail
  347.  
  348.         move.l #$01000000,a1
  349.         move.l a1,a0
  350.         sub.l -$14(a0),a0                       ;lower
  351.         move.l #(1<<mapp_rom),d0                ;status
  352.         bsr _AddMap
  353.         beq .fail
  354.                                                 ;I don't want to add the 0xf0000000
  355.                                                 ;memory area. Undocumented
  356.         move.l a6,a5
  357.         move.l mulib_SysBase(a6),a6
  358.         jsr Forbid(a6)
  359.  
  360.         moveq #0,d0
  361.         move.l MemList(a6),a0                   ;get list of all memheaders
  362.         do
  363.          tst.l (a0)
  364.          break.s eq
  365.          move.w mh_Attributes(a0),d0            ;get the attributes of this list
  366.          move.l d0,-(a7)                        ;save to stack
  367.          move.l mh_Upper(a0),-(a7)
  368.          move.l mh_Lower(a0),-(a7)              ;save lower
  369.          move.l (a0),a0                         ;get next
  370.         loop.s
  371.  
  372.         jsr Permit(a6)                          ;done
  373.         move.l a5,a6                            ;restore mubase
  374.  
  375.         moveq #1,d0
  376.         do
  377.          cmp.l a4,a7
  378.          break.s hs                             ;if all done, return
  379.  
  380.          move.l #(1<<mapp_copyback),d0          ;enable copyback if FAST
  381.          movem.l (a7)+,a0-a1                    ;get upper, lower
  382.          move.l (a7)+,d1                        ;get attributes
  383.          btst #1,d1                             ;chip mem?
  384.          beq.s .isfast
  385.          move.l #(1<<mapp_cacheinhibit),d0      ;if so, cache inhibited, precise exception model
  386. .isfast:
  387.          bsr _AddMap
  388.         while.s ne
  389.                                                 ;here: failure, whatever
  390.         move.l a4,a7                            ;restore stack
  391.         tst.l d0                                ;failure ?
  392.         beq .fail
  393.  
  394.         sub.l a4,a4                             ;configdev
  395.         do
  396.          move.l mulib_ExpansionBase(a6),a6      ;Expansion list
  397.          move.l a4,a0                           ;start with this configdev
  398.          moveq #-1,d0
  399.          move.l d0,d1                           ;any manufacturer
  400.          jsr FindConfigDev(a6)                  ;find configdevs
  401.          move.l d0,a4                           ;a configdev present
  402.          move.l a5,a6
  403.          tst.l d0
  404.          break.s eq                             ;if not, then exit
  405.  
  406.          btst #ERTB_MEMLIST,er_Type(a4)         ;is this external memory?
  407.          reloop.s ne                            ;if so, ignore it
  408.          movem.l cd_BoardAddr(a4),a0-a1         ;get address of the board
  409.          adda.l a0,a1                           ;upper size
  410.          move.l #(1<<mapp_cacheinhibit),d0      ;cache inhibited, precise exception model
  411.          bsr _AddMap
  412.          beq .fail
  413.         loop.s
  414.  
  415.         move.l #$bc0000,a0                      ;actually, $bf0000. Don't be picky
  416.         move.l #$c00000,a1
  417.         move.l #(1<<mapp_cacheinhibit),d0       ;cache inhibited, precise exception model
  418.         bsr _AddMap                             ;add the CIAs
  419.         beq .fail
  420.  
  421.         move.l #$d80000,a0                      ;actually, $dc0000
  422.         move.l #$e00000,a1                      ;Clock,SCSI,Motherboard resources,Chip Registers
  423.         move.l #(1<<mapp_cacheinhibit),d0       ;cache inhibited, precise exception model
  424.         bsr _AddMap                             ;add the CIAs
  425.         beq .fail
  426.  
  427.         sub.l a0,a0
  428.         move.l #$1000,a1
  429.         move.l #(1<<mapp_cacheinhibit),d0       ;cache inhibited, precise exception model
  430.         bsr _AddMap                             ;this is CHIP, but definitely available even though not in the memory list
  431.         beq .fail
  432.  
  433.         move.l mulib_SysBase(a6),a6
  434.         lea CardName,a1
  435.         jsr OpenResource(a6)                    ;card.resource available?
  436.         move.l a5,a6
  437.         tst.l d0
  438.         beq.s .nocard
  439.  
  440.         move.l #$600000,a0                      ;base of the card resource
  441.         move.l #$a80000,a1                      ;is this right? (Nope. THATs right!)
  442.         move.l #(1<<mapp_cacheinhibit),d0       ;cache inhibited, precise exception model
  443.         bsr _AddMap
  444.         beq .fail
  445.  
  446.         ;move.l #$da0000,a0                      ;Gayle registers for IDE and PCMCIA
  447.         ;move.l #$db0000,a1
  448.         ;move.l #(1<<mapp_cacheinhibit),d0       ;cache inhibited, precise exception model
  449.         ;bsr _AddMap
  450.         ;beq.s .fail                            ;already mapped out
  451.  
  452.  
  453. .nocard:
  454.         move.l mulib_SysBase(a6),a6
  455.         lea CDStrapName,a1
  456.         jsr FindResident(a6)                    ;cd available?
  457.         move.l a5,a6
  458.         tst.l d0
  459.         beq.s .nocd
  460.  
  461.         move.l #$e00000,a0                      ;base of the cd ROM
  462.         move.l #$e80000,a1                      ;is this right?
  463.         move.l #(1<<mapp_cacheinhibit),d0       ;cache inhibited, precise exception model
  464.         bsr _AddMap
  465.         beq.s .fail
  466.  
  467.         move.l #$b80000,a0                      ;ditto
  468.         move.l #$bc0000,a1
  469.         move.l #(1<<mapp_cacheinhibit),d0       ;cache inhibited, precise exception model
  470.         bsr _AddMap
  471.         beq.s .fail
  472. .nocd:
  473.         move.l mulib_SysBase(a6),a0
  474.         move.l $a(a0),d0                        ;get name
  475.         clr.w d0
  476.         moveq #$20,d1
  477.         swap d0
  478.         cmp.l d1,d0                             ;is this name in 20K up ?
  479.         bne.s .noexec
  480.  
  481.         move.l #$200000,a0
  482.         move.l #$280000,a1                      ;is this a mapped ROM image
  483.         move.l #(1<<mapp_writeprotected),d0     ;status
  484.         bsr _AddMap
  485.         beq.s .fail
  486. .noexec:
  487.  
  488.         move.l #$ff000000,a0
  489.         move.l #$ff010000,a1
  490.         move.l #(1<<mapp_cacheinhibit),d0       ;add the Zorro-III Configuration Unit
  491.         bsr _AddMap
  492.         beq.s .fail
  493.  
  494.         moveq #1,d0
  495. .fail:
  496.         loadregs
  497.         rts
  498.  
  499. _AddMap:
  500.         reserve map_len
  501.         move.l d0,map_properties(a7)
  502.         move.l a0,d0                            ;get lower
  503.         and.l mulib_PageMask(a6),d0
  504.         clr.l map_userptr(a7)
  505.         move.l d0,map_lower(a7)
  506.         move.l a1,d0
  507.         subq.l #1,d0
  508.         add.l mulib_PageSize(a6),d0
  509.         clr.l map_flags(a7)
  510.         and.l mulib_PageMask(a6),d0
  511.         moveq #-1,d1
  512.         subq.l #1,d0
  513.         move.l d0,map_higher(a7)
  514.         move.l d1,map_mask(a7)                  ;mask in all bits
  515.         move.l a2,a0
  516.         move.l a7,a1
  517.         bsr DefineMapping
  518.         restore
  519.         rts
  520. ;ENDFOLD
  521. ;FOLD AddTransparentTranslation
  522. ;*************************************************
  523. ;** AddTransparentTranslation                   **
  524. ;**                                             **
  525. ;** Modify the context *a0 according to the     **
  526. ;** address and mask in a1                      **
  527. ;** Enable the properties d0, mask in d1        **
  528. ;** Context in a0                               **
  529. ;*************************************************
  530.         xdef AddTransparentTranslation
  531. AddTransparentTranslation:
  532.         saveregs d2-d6/a2
  533.         defvar
  534.          auto.b att_map,map_len
  535.         endvar
  536.  
  537.         move.l a1,d2                    ;this is the mask
  538.         move.l d0,map_Properties(a7)
  539.         move.l a1,d3
  540.         move.l d1,map_Mask(a7)
  541.         not.b d2
  542.         lsr.l #8,d3                     ;this is the address
  543.         clr.l map_UserPtr(a7)
  544.         moveq #0,d4
  545.         move.l #$01000000,d6            ;increment
  546.         move.l a0,a2                    ;keep context
  547.         moveq #0,d5
  548.         do
  549.          move.w d4,d0                   ;get the address
  550.          eor.b d3,d0                    ;compare with the address
  551.          and.b d2,d0                    ;and mask
  552.          bne.s .next                    ;does it match ?
  553.          move.l d5,map_lower(a7)
  554.          move.l a2,a0
  555.          move.l d5,map_higher(a7)
  556.          add.l d6,map_higher(a7)
  557.          move.l a7,a1
  558.          subq.l #1,map_higher(a7)
  559.          bsr DefineMapping
  560.          beq.s .exit
  561. .next:
  562.          add.l d6,d5
  563.          addq.b #1,d4
  564.         while.s ne
  565.  
  566.         moveq #1,d0
  567. .exit:
  568.         freevar
  569.         loadregs
  570.         rts
  571. ;ENDFOLD
  572.  
  573. ;FOLD SetGlobal
  574. ;*************************************************
  575. ;** SetGlobal                                   **
  576. ;** define the context *a0 and all pages in it  **
  577. ;** as global                                   **
  578. ;*************************************************
  579.         xdef SetGlobal
  580. SetGlobal:
  581.         bsr LockContext                 ;arbitrate access
  582.  
  583.         bsetm ctxf_global,ctx_Flags(a0) ;now the global
  584.         move.l ctx_Mapping(a0),a1       ;for all map nodes in this context
  585.         do
  586.          tst.l (a1)                     ;end of list ?
  587.          break.s eq
  588.  
  589.          bsetm mapp_global,map_Properties(a1)   ;set the global mask
  590.          bne.s .next
  591.  
  592.          bsetm mapf_dirty,map_Flags(a1) ;this map has to be rebuild
  593.          bsetm ctxf_dirty,ctx_Flags(a0) ;and therefore the context
  594. .next:
  595.          move.l (a1),a1                 ;next please
  596.         loop
  597.  
  598.         bsr UnlockContext               ;release Context
  599.         rts
  600. ;ENDFOLD
  601.  
  602.         section main_data,data
  603. ;FOLD Strings
  604. CardName:       dc.b "card.resource",0
  605. CDStrapName:    dc.b "cdstrap",0
  606. ;ENDFOLD
  607. ;
  608.